﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using OgilvyOne.Model;
using OgilvyOne.BLL;

public partial class DataBaseManage_LogSwitch : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.headers.Text = new ColumnBll().LayeridSysColumnNaiv(Layerid);//系统
            string url = "log_switch.aspx?layerid=" + Request.Params["layerid"];
            this.headers.Text += "<img src='../images/subnav_dot.gif' width='9' height='9' />&nbsp;&nbsp;<a href='" + url + "'>日志开关</a>&nbsp;&nbsp";
            LogSwitchs ls = new LogSwitchs();
            LogManageBLL lmb = new LogManageBLL();
            ls=lmb.selectLogsSwitch();
            if (ls.Switchs == 0)
            {
                this.RadioButton1.Checked = true;
            }
            else
            {
                this.RadioButton2.Checked = true;
            }
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {

        Response.Redirect("log_Manage.aspx?layerid=" + Request.Params["layerid"]);
        return;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        PopedomValidate(layerid,MOD);
        switchs();
        Response.Redirect("log_Manage.aspx?layerid=" + Request.Params["layerid"]);
        return;
    }
    private void switchs()
    {
        LogSwitchs ls = new LogSwitchs();
        LogManageBLL lmb = new LogManageBLL();
        ls.id = 1;
        if (RadioButton1.Checked == true)
        {
            ls.Switchs = 0;
        }
        if (RadioButton2.Checked == true)
        {
            ls.Switchs = 1;
        }
        lmb.SwitchsLogs(ls);
    }
}
